import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '@/views/LayoutView.vue'
export const routes = [
  {
    path: '',
    name: 'index',
    component: LayoutView,
    redirect: '/table',
    meta: { title: '首页' },
    children: [
      {
        path: '/table',
        name: 'table',
        meta: { title: '成绩', icon: 'icon-chengji-' },
        component: () => import('../views/component/TableView.vue')
      },
      {
        path: '/user',
        name: 'user',
        meta: { title: '我的信息', icon: 'icon-wo' },
        component: () => import('../views/UserView.vue')
      },
      {
        path: '/customer',
        name: 'customer',
        meta: { title: '用户', icon: 'icon-yonghu1' },
        component: () => import('../views/CustomerView.vue')
      },
      {
        path: '/dailyReport',
        name: 'dailyReport',
        meta: { title: '日报处理', icon: 'icon-rizhi' },
        component: () => import('../views/readGit/IndexView.vue')
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('../views/HomeView.vue')
      },
      {
        path: '/echarts',
        name: 'echarts',
        meta: { title: '图表', icon: 'icon-tubiao-zhexiantu' },
        component: () => import('../views/echarts/IndexView.vue')
      },
      {
        path: '/vue',
        name: 'vue',
        meta: { title: '框架基础', icon: 'icon-jiaoshoujia' },
        component: () => import('../views/vue/IndexView.vue'),
        children: [
          {
            path: 'vmodel',
            name: 'vmodel',
            meta: { title: 'V_MODEL' },
            component: () => import('../views/vue/VModel/VModel.vue')
          },
          {
            path: 'html',
            name: 'html',
            meta: { title: 'HTML' },
            component: () => import('../views/vue/HtmlView.vue')
          },
          {
            path: 'refReactive',
            name: 'refReactive',
            meta: { title: 'RefReactive混用' },
            component: () => import('../views/vue/RefReactiveView.vue')
          },
          {
            path: 'computed',
            name: 'computed',
            meta: { title: '计算属性' },
            component: () => import('../views/vue/ComputedView.vue')
          },
          {
            path: 'class',
            name: 'class',
            meta: { title: '绑定类名' },
            component: () => import('../views/vue/ClassView.vue')
          },
          {
            path: 'style',
            name: 'style',
            meta: { title: '绑定样式' },
            component: () => import('../views/vue/StyleView.vue')
          },
          {
            path: 'v-for',
            name: 'v-for',
            meta: { title: 'v-for' },
            component: () => import('../views/vue/V-forView.vue')
          },
          {
            path: 'event',
            name: 'event',
            meta: { title: '方法事件与内联事件' },
            component: () => import('../views/vue/EventView.vue')
          },
          {
            path: 'decorate',
            name: 'decorate',
            meta: { title: '修饰符使用' },
            component: () => import('../views/vue/DecorateView.vue')
          },
          {
            path: 'lifeCycle',
            name: 'lifeCycle',
            meta: { title: '组件生命周期' },
            component: () => import('../views/vue/LifeCycleView.vue')
          },
          {
            path: 'cache',
            name: 'cache',
            meta: { title: '缓存组件' },
            component: () => import('../views/vue/CacheView.vue')
          },
          {
            path: 'inject',
            name: 'inject',
            meta: { title: '依赖注入' },
            component: () => import('../views/vue/InjectView.vue')
          },
          {
            path: 'v-bind',
            name: 'v-bind',
            meta: { title: 'v-bind' },
            component: () => import('../views/vue/V-bindView.vue')
          },
          {
            path: 'v-slot',
            name: 'v-slot',
            meta: { title: '插槽' },
            component: () => import('../views/vue/V-slotView.vue')
          },
          {
            path: 'transition',
            name: 'transition',
            meta: { title: '过渡效果' },
            component: () => import('../views/vue/TransitionView.vue')
          },
          {
            path: 'teleport',
            name: 'teleport',
            meta: { title: 'Teleport组件' },
            component: () => import('../views/vue/TeleportView.vue')
          },
          {
            path: 'hfunction',
            name: 'hfunction',
            meta: { title: 'h函数' },
            component: () => import('../views/vue/HfunctionView.vue')
          },
          {
            path: 'combiningFun',
            name: 'combiningFun',
            meta: { title: '组合函数' },
            component: () => import('../views/vue/CombiningFunView.vue')
          },
          {
            path: 'statusManage',
            name: 'statusManage',
            meta: { title: '简单状态管理' },
            component: () => import('../views/vue/StatusManageView.vue')
          }
        ]
      },
      {
        path: '/component',
        name: 'component',
        meta: { title: '组件', icon: 'icon-zujian' },
        component: () => import('../views/component/IndexView.vue'),
        children: [
          {
            path: 'elementplus',
            name: 'elementplus',
            meta: { title: '组件通信' },
            component: () => import('../views/component/ElementPlusView.vue')
          },
          {
            path: 'slot',
            name: 'slot',
            meta: { title: '插槽' },
            component: () => import('../views/component/SlotView.vue')
          },
          {
            path: 'myCron',
            name: 'myCron',
            meta: { title: '我上传的组件' },
            component: () => import('../views/component/MyCronView.vue')
          },
          {
            path: 'toolTip',
            name: 'toolTip',
            meta: { title: '封装toolTip组件' },
            component: () => import('../views/component/ToolTipView.vue')
          },
          {
            path: 'tableSelect',
            name: 'tableSelect',
            meta: { title: '表格跨页选择' },
            component: () => import('../views/component/TableSelectView.vue')
          },
          {
            path: 'editor',
            name: 'editor',
            meta: { title: '代码编辑器组件' },
            component: () => import('../views/component/EditorView.vue')
          },
          {
            path: 'draggable',
            name: 'draggable',
            meta: { title: '拖动' },
            component: () => import('../views/component/DraggableView.vue')
          }
        ]
      },
      {
        path: '/simpleRouter',
        name: 'simpleRouter',
        meta: { title: '简单路由实现', icon: 'icon-luyouqi' },
        component: () => import('../views/SimpleRouterView.vue')
      },
      {
        path: '/lodash',
        name: 'lodash',
        meta: { title: 'lodash', icon: 'icon-lodash' },
        component: () => import('../views/lodash/IndexView.vue'),
        children: [
          {
            path: 'lodashEs',
            name: 'lodashEs',
            meta: { title: '使用lodashEs' },
            component: () => import('../views/lodash/LodashEsView.vue')
          },
          {
            path: 'debounce',
            name: 'debounce',
            meta: { title: '使用防抖' },
            component: () => import('../views/lodash/DebounceView.vue')
          }
        ]
      },
      {
        path: '/pinia',
        name: 'pinia',
        meta: { title: 'pinia状态管理', icon: 'icon-shujugongxiang' },
        component: () => import('../views/pinia/IndexView.vue'),
        children: [
          {
            path: 'basic',
            name: 'piniabasic',
            meta: { title: '基础使用' },
            component: () => import('../views/pinia/PiniaView.vue')
          },
          {
            path: 'storeToRefs',
            name: 'storeToRefs',
            meta: { title: '使用storeToRefs' },
            component: () => import('../views/pinia/StoreToRefsView.vue')
          },
          {
            path: 'piniaStore',
            name: 'piniaStore',
            meta: { title: '定义piniaStore' },
            component: () => import('../views/pinia/PiniaStoreView.vue')
          },
          {
            path: 'getters',
            name: 'getters',
            meta: { title: '使用getters' },
            component: () => import('../views/pinia/GettersView.vue')
          },
          {
            path: 'actions',
            name: 'actions',
            meta: { title: '使用actions' },
            component: () => import('../views/pinia/ActionsView.vue')
          }
        ]
      },
      {
        path: '/api',
        name: 'api',
        meta: { title: '接口调用', icon: 'icon-api' },
        component: () => import('../views/api/IndexView.vue'),
        children: [
          {
            path: 'get',
            name: 'basic',
            meta: { title: 'get请求' },
            component: () => import('../views/api/GetView.vue')
          },
          {
            path: 'form',
            name: 'form',
            meta: { title: '原生表单' },
            component: () => import('../views/api/FormView.vue')
          },
          {
            path: 'score',
            name: 'score',
            meta: { title: '口算成绩' },
            component: () => import('../views/api/ScoreView.vue')
          }
        ]
      },
      {
        path: '/qiankun',
        name: 'qiankun',
        meta: { title: '微应用', icon: 'icon-qiankun-logo' },
        component: () => import('../views/qiankun/IndexView.vue'),
        children: [
          {
            path: 'vue2',
            name: 'vue2',
            children: []
          },
          {
            path: 'react/chinese',
            name: 'chinese',
            meta: { title: '语文' },
            children: []
          },
          {
            path: 'react/math',
            name: 'math',
            meta: { title: '加减' },
            children: []
          },
          {
            path: 'react/multiply',
            name: 'multiply',
            meta: { title: '乘加乘减' },
            children: []
          }
        ]
      },
      {
        path: '/postMessage',
        name: 'postMessage',
        meta: { title: '浏览器跨页签通信', icon: 'icon-tongxin' },
        component: () => import('../views/PostMessageView.vue')
      },
      {
        path: '/indexdb',
        name: 'indexdb',
        meta: { title: '浏览器数据库', icon: 'icon-indexdb' },
        component: () => import('../views/IndexdbView.vue')
      },
      {
        path: '/filter',
        name: 'filter',
        meta: { title: '筛选器', icon: 'icon-zidingyishaixuanqi' },
        component: () => import('../views/filter/IndexView.vue')
      },
      {
        path: '/tecent',
        name: 'tecent',
        meta: { title: '面试题', icon: 'icon-flow-interview' },
        component: () => import('../views/TecentView.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('../views/FzfView.vue')
  }
]
const router = createRouter({
  history: createWebHistory('/'),
  routes
})

export default router
